const router = require('express').Router();
const upload = require('../utils/upload');
// 上传文件接口

router.post('/upload', upload.single("file"), (req,res)=>{
  console.log(req.file);
  const file = "/static/uploads/" + req.file.filename
  res.send({
    code: 200,
    msg: '上传成功',
    data: {
      file
    }
  })
})

module.exports = router;